BenSelect Documentation
Forms - Scripting multiple contingent beneficiaries
Send Feedback
JScript Examples > JScript for Field Mapping > Forms - Scripting multiple contingent beneficiaries

Glossary Item Box

Use this code to script for beneficiaries when you have contingents for multiple insureds (i.e., one set for employee and one for spouse).
 

var c = 1;

while (Event.Fields['Engine.BMELO.EmployeeInsured.BeneficiaryArray.Beneficiary_' + c + '.BeneficiaryType'] && Event.Fields['Engine.BMELO.EmployeeInsured.BeneficiaryArray.Beneficiary_' + c + '.BeneficiaryType'] == 'Primary') {

c++;

}

if (Event.Fields['Engine.BMELO.EmployeeInsured.BeneficiaryArray.Beneficiary_' + c + '.BeneficiaryType'] && Event.Fields['Engine.BMELO.EmployeeInsured.BeneficiaryArray.Beneficiary_' + c + '.BeneficiaryType'] == 'Contingent') {

Event.Fields['Contingent_1.Name'] = Event.Fields['Engine.BMELO.EmployeeInsured.BeneficiaryArray.Beneficiary_' + c + '.Name'];

Event.Fields['Contingent_1.Relationship'] = Event.Fields['Engine.BMELO.EmployeeInsured.BeneficiaryArray.Beneficiary_' + c + '.Relationship'];

Event.Fields['Contingent_1.Age'] = Event.Fields['Engine.BMELO.EmployeeInsured.BeneficiaryArray.Beneficiary_' + c + '.Age'];

}

 

var d = 1;

while (Event.Fields['Engine.BMELO.SpouseInsured.BeneficiaryArray.Beneficiary_' + d + '.BeneficiaryType'] && Event.Fields['Engine.BMELO.SpouseInsured.BeneficiaryArray.Beneficiary_' + d + '.BeneficiaryType'] == 'Primary') {

d++;

}

if (Event.Fields['Engine.BMELO.SpouseInsured.BeneficiaryArray.Beneficiary_' + d + '.BeneficiaryType'] && Event.Fields['Engine.BMELO.SpouseInsured.BeneficiaryArray.Beneficiary_' + d + '.BeneficiaryType'] == 'Contingent') {

Event.Fields['Contingent_2.Name'] = Event.Fields['Engine.BMELO.SpouseInsured.BeneficiaryArray.Beneficiary_' + d + '.Name'];

Event.Fields['Contingent_2.Relationship'] = Event.Fields['Engine.BMELO.SpouseInsured.BeneficiaryArray.Beneficiary_' + d + '.Relationship'];

Event.Fields['Contingent_2.Age'] = Event.Fields['Engine.BMELO.SpouseInsured.BeneficiaryArray.Beneficiary_' + d + '.Age'];

}


 

©2024. All Rights Reserved.